<script>
	function checkEnvironment() {
		let userAgent = navigator.userAgent.toLowerCase();
		let isWeChat = userAgent.indexOf("micromessenger") !== -1;
		let isRegularBrowser = !isWeChat;

		return {
			isWeChat: isWeChat,
			isRegularBrowser: isRegularBrowser,
		};
	}

	export default {
		globalData: {
			num: null
		},
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			let environment = checkEnvironment();
			if (environment.isWeChat) {
				// 微信浏览器中的代码
			} else if (environment.isRegularBrowser) {
				uni.reLaunch({
					url: "/pages/error/error",
				});
			}
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>